var createChess;
var createChessDown = createChessDownMethod();
var chessColorEnum = createChessColorEnum();
var chessDownTurnEnum = createChessDownTurnEnum();

function createChess(color) {
	let createChess = {
		"chess_1": {
			css: 'background-image: url("images/chess/'+color+'/chess_1.png");width: 35px;height: 35px;background-size: 35px 35px;margin-top: 75px;'
		},
		"chess_2": {
			css: 'background-image: url("images/chess/'+color+'/chess_2.png");width: 70px;height: 35px;background-size: 70px 35px;margin-top: 75px;'
		},
		"chess_3_1": {
			css: 'background-image: url("images/chess/'+color+'/chess_3_1.png");width: 105px;height: 35px;background-size: 105px 35px;margin-top: 75px;'
		},
		"chess_3_2": {
			css: 'background-image: url("images/chess/'+color+'/chess_3_2.png");width: 70px;height: 70px;background-size: 70px 70px;margin-top: 50px;'
		},
		"chess_4_1": {
			css: 'background-image: url("images/chess/'+color+'/chess_4_1.png");width: 140px;height: 35px;background-size: 140px 35px;margin-top: 75px;'
		},
		"chess_4_2": {
			css: 'background-image: url("images/chess/'+color+'/chess_4_2.png");width: 105px;height: 70px;background-size: 105px 70px;margin-top: 50px;'
		},
		"chess_4_3": {
			css: 'background-image: url("images/chess/'+color+'/chess_4_3.png");width: 105px;height: 70px;background-size: 105px 70px;margin-top: 50px;'
		},
		"chess_4_4": {
			css: 'background-image: url("images/chess/'+color+'/chess_4_4.png");width: 70px;height: 70px;background-size: 70px 70px;margin-top: 50px;'
		},
		"chess_4_5": {
			css: 'background-image: url("images/chess/'+color+'/chess_4_5.png");width: 105px;height: 70px;background-size: 105px 70px;margin-top: 50px;'
		},
		"chess_5_1": {
			css: 'background-image: url("images/chess/'+color+'/chess_5_1.png");width: 175px;height: 35px;background-size: 175px 35px;margin-top: 75px;'
		},
		"chess_5_2": {
			css: 'background-image: url("images/chess/'+color+'/chess_5_2.png");width: 140px;height: 70px;background-size: 140px 70px;margin-top: 50px;'
		},
		"chess_5_3": {
			css: 'background-image: url("images/chess/'+color+'/chess_5_3.png");width: 140px;height: 70px;background-size: 140px 70px;margin-top: 50px;'
		},
		"chess_5_4": {
			css: 'background-image: url("images/chess/'+color+'/chess_5_4.png");width: 105px;height: 105px;background-size: 105px 105px;margin-top: 30px;'
		},
		"chess_5_5": {
			css: 'background-image: url("images/chess/'+color+'/chess_5_5.png");width: 105px;height: 70px;background-size: 105px 70px;margin-top: 50px;'
		},
		"chess_5_6": {
			css: 'background-image: url("images/chess/'+color+'/chess_5_6.png");width: 105px;height: 70px;background-size: 105px 70px;margin-top: 50px;'
		},
		"chess_5_7": {
			css: 'background-image: url("images/chess/'+color+'/chess_5_7.png");width: 105px;height: 105px;background-size: 105px 105px;margin-top: 30px;'
		},
		"chess_5_8": {
			css: 'background-image: url("images/chess/'+color+'/chess_5_8.png");width: 105px;height: 105px;background-size: 105px 105px;margin-top: 30px;'
		},
		"chess_5_9": {
			css: 'background-image: url("images/chess/'+color+'/chess_5_9.png");width: 105px;height: 105px;background-size: 105px 105px;margin-top: 30px;'
		},
		"chess_5_10": {
			css: 'background-image: url("images/chess/'+color+'/chess_5_10.png");width: 105px;height: 105px;background-size: 105px 105px;margin-top: 30px;'
		},
		"chess_5_11": {
			css: 'background-image: url("images/chess/'+color+'/chess_5_11.png");width: 140px;height: 70px;background-size: 140px 70px;margin-top: 50px;'
		},
		"chess_5_12": {
			css: 'background-image: url("images/chess/'+color+'/chess_5_12.png");width: 105px;height: 105px;background-size: 105px 105px;margin-top: 30px;'
		},
	}
	return createChess;
}

/**
 * 以下变量用于重新确认图片中心,默认坐标是该div左上角的点的坐标
 * positionX: x坐标偏移量
 * positionY: y坐标偏移量
 */
function createChessDownMethod() {
	let createChessDown = {
		"chess_1_down" : {
			positionX : 1,
			positionY: 1,
			left: 0,
			right: 0,
			top: 0,
			bottom: 0,
			left_top: 0,
			left_bottom: 0,
			right_top: 0,
			right_bottom: 0,
			width: 1,
			height: 1,
			number: 1
		},
		"chess_2_down" : {
			positionX : 1,
			positionY: 1,
			left: 0,
			right: 1,
			top: 0,
			bottom: 0,
			left_top: 0,
			left_bottom: 0,
			right_top: 0,
			right_bottom: 0,
			width: 2,
			height: 1,
			number: 2
		},
		"chess_3_1_down" : {
			positionX : 1,
			positionY: 1,
			left: 0,
			right: 2,
			top: 0,
			bottom: 0,
			left_top: 0,
			left_bottom: 0,
			right_top: 0,
			right_bottom: 0,
			width: 3,
			height: 1,
			number: 3
		},
		"chess_3_2_down" : {
			positionX : 1,
			positionY: 1,
			left: 0,
			right: 0,
			top: 0,
			bottom: 1,
			left_top: 0,
			left_bottom: 0,
			right_top: 0,
			right_bottom: 1,
			width: 2,
			height: 2,
			number: 3
		},
		"chess_4_1_down" : {
			positionX : 1,
			positionY: 1,
			left: 0,
			right: 3,
			top: 0,
			bottom: 0,
			left_top: 0,
			left_bottom: 0,
			right_top: 0,
			right_bottom: 0,
			width: 4,
			height: 1,
			number: 4
		},
		"chess_4_2_down" : {
			positionX : 2,
			positionY: 1,
			left: 0,
			right: 2,
			top: 1,
			bottom: 0,
			left_top: 0,
			left_bottom: 0,
			right_top: 0,
			right_bottom: 0,
			width: 3,
			height: 2,
			number: 4
		},
		"chess_4_3_down" : {
			positionX : 2,
			positionY: 2,
			left: 1,
			right: 1,
			top: 1,
			bottom: 0,
			left_top: 0,
			left_bottom: 0,
			right_top: 0,
			right_bottom: 0,
			width: 3,
			height: 2,
			number: 4
		},
		"chess_4_4_down" : {
			positionX : 1,
			positionY: 1,
			left: 0,
			right: 1,
			top: 0,
			bottom: 1,
			left_top: 0,
			left_bottom: 0,
			right_top: 0,
			right_bottom: 1,
			width: 2,
			height: 2,
			number: 4
		},
		"chess_4_5_down" : {
			positionX : 1,
			positionY: 2,
			left: 1,
			right: 0,
			top: 0,
			bottom: 1,
			left_top: 0,
			left_bottom: 0,
			right_top: 0,
			right_bottom: 1,
			width: 3,
			height: 2,
			number: 4
		},
		"chess_5_1_down" : {
			positionX : 1,
			positionY: 1,
			left: 0,
			right: 4,
			top: 0,
			bottom: 0,
			left_top: 0,
			left_bottom: 0,
			right_top: 0,
			right_bottom: 0,
			width: 5,
			height: 1,
			number: 5
		},
		"chess_5_2_down" : {
			positionX : 2,
			positionY: 1,
			left: 0,
			right: 3,
			top: 1,
			bottom: 0,
			left_top: 0,
			left_bottom: 0,
			right_top: 0,
			right_bottom: 0,
			width: 4,
			height: 2,
			number: 5
		},
		"chess_5_3_down" : {
			positionX : 2,
			positionY: 2,
			left: 1,
			right: 2,
			top: 1,
			bottom: 0,
			left_top: 0,
			left_bottom: 0,
			right_top: 0,
			right_bottom: 0,
			width: 4,
			height: 2,
			number: 5
		},
		"chess_5_4_down" : {
			positionX : 2,
			positionY: 2,
			left: 1,
			right: 1,
			top: 1,
			bottom: 1,
			left_top: 0,
			left_bottom: 0,
			right_top: 0,
			right_bottom: 0,
			width: 3,
			height: 3,
			number: 5
		},
		"chess_5_5_down" : {
			positionX : 1,
			positionY: 2,
			left: 1,
			right: 0,
			top: 0,
			bottom: 1,
			left_top: 0,
			left_bottom: 1,
			right_top: 0,
			right_bottom: 1,
			width: 3,
			height: 2,
			number: 5
		},
		"chess_5_6_down" : {
			positionX : 2,
			positionY: 2,
			left: 1,
			right: 1,
			top: 0,
			bottom: 0,
			left_top: 1,
			left_bottom: 0,
			right_top: 1,
			right_bottom: 0,
			width: 3,
			height: 2,
			number: 5
		},
		"chess_5_7_down" : {
			positionX : 2,
			positionY: 2,
			left: 0,
			right: 0,
			top: 1,
			bottom: 1,
			left_top: 0,
			left_bottom: 1,
			right_top: 0,
			right_bottom: 1,
			width: 3,
			height: 3,
			number: 5
		},
		"chess_5_8_down" : {
			positionX : 2,
			positionY: 2,
			left: 1,
			right: 1,
			top: 0,
			bottom: 1,
			left_top: 1,
			left_bottom: 0,
			right_top: 0,
			right_bottom: 0,
			width: 3,
			height: 3,
			number: 5
		},
		"chess_5_9_down" : {
			positionX : 2,
			positionY: 2,
			left: 1,
			right: 1,
			top: 0,
			bottom: 0,
			left_top: 1,
			left_bottom: 0,
			right_top: 0,
			right_bottom: 1,
			width: 3,
			height: 3,
			number: 5
		},
		"chess_5_10_down" : {
			positionX : 2,
			positionY: 2,
			left: 1,
			right: 0,
			top: 0,
			bottom: 1,
			left_top: 1,
			left_bottom: 0,
			right_top: 0,
			right_bottom: 1,
			width: 3,
			height: 3,
			number: 5
		},
		"chess_5_11_down" : {
			positionX : 2,
			positionY: 2,
			left: 0,
			right: 2,
			top: 1,
			bottom: 0,
			left_top: 1,
			left_bottom: 0,
			right_top: 0,
			right_bottom: 0,
			width: 4,
			height: 2,
			number: 5
		},
		"chess_5_12_down" : {
			positionX : 1,
			positionY: 3,
			left: 2,
			right: 0,
			top: 0,
			bottom: 2,
			left_top: 0,
			left_bottom: 0,
			right_top: 0,
			right_bottom: 0,
			width: 3,
			height: 3,
			number: 5
		}
	}
	return createChessDown;
}

function createChessColorEnum() {
	let chessColorEnum = {
		1: "yellow",
		2: "blue",
		3: "red",
		4: "green"
	}
	return chessColorEnum;
}

function createChessDownTurnEnum() {
	let chessDownTurnEnum = {
		"yellow": 1,
		"blue": 2,
		"red": 3,
		"green": 4
	}
	return chessDownTurnEnum;
}
